//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright 2007 CORE Solutions Limited
// All rights reserved.
// PROPRIETARY AND CONFIDENTIAL INFORMATION.
// Use is subject to license terms.
//
// FUNCTION ID      :   COUNTRY
// AUTHOR           :   Craig Chun 
// DATE CREATE      :   2007/07/12
// DESCRIPTION      :   a COMMON DELEGATE file for the function, COUNTRY
//                  :   
//                  :   
//                  :   
//
// MODIFICATION HISTORY:
// DATE         AUTHOR          VERSION NO.         COMMENT
// -----------  --------------  ------------------  -------------------
// 2007/07/12   Craig Chun      1.0                 source is generated.
//
//
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

package com.erp.app.setup.country.delegate;

import com.erp.app.setup.country.dao.CountryCommonDao;
import com.erp.app.setup.country.bizLogic.CountryCommonUtil;

/**
* <p>A <strong>Delegate</strong> provides the logical flow and control
* of the business model.
*
* @author          Craig Chun 
* @version 1.0     2007/07/12
* @since           FrameWork 1.1
*
*/
public class CountryCommonDelegate {

	private CountryCommonUtil util = new CountryCommonUtil();
	private CountryCommonDao dao = new CountryCommonDao();

	//THE FOLLOW SAMPLE FUNCTION CAN ONLY BE MODIFIED FOR SQL SELECT OPERATIONS, NEVER FOR INSERT/UPDATE/DELETE OPERATIONS
	//throws exceptions can be: FindRecordException
	//	public ArrayList findComponents(QuotHdrVo model, String itemCode, String companyCode) throws FindRecordException {
	//	Connection conn = null;
	//		ArrayList rsltList = new ArrayList();
	//
	//		try {
	//			ServiceLocator srvLocator = ServiceLocator.getInstance();
	//			conn = srvLocator.getDSDBConnection();
	//			rsltList = dao.findComponents(model, itemCode, companyCode, conn);
	//
	//		} catch (Exception e) {
	//			Logger.logExceptions(this, e);
	//			throw new FindRecordException(e.getMessage());
	//		} finally {
	//			try {
	//				conn.close();
	//			} catch (Exception e) {
	//				Logger.logExceptions(this, e);
	//			}
	//		}
	//
	//		return rsltList;
	//	}

	//THE FOLLOW SAMPLE FUNCTION CAN BE MODIFIED FOR SQL SELECT/INSERT/UPDATE/DELETE OPERATIONS
	//throws exceptions can be either: CreateRecordException, ModifyRecordException, DeleteRecordException, or FindRecordException
//	public void sampleTransaction(SimpleBaseVo model, Object obj) throws DeleteRecordException, FindRecordException {
//
//		ServiceLocator srvLocator = ServiceLocator.getInstance();
//		SimpleBaseDao dao = null;
//		Connection conn = null;
//		SimpleBaseVo targetModel = null;
//
//		try {
//
//			conn = srvLocator.getDSDBConnection();
//			dao = (SimpleBaseDao) model.getDaoType().newInstance();
//			UserTransaction userTrans = srvLocator.getUserTransaction();
//			userTrans.begin();
//
//			try {
//
//				// call your dao function here, for example:
//				// dao.trans(model, conn);
//				userTrans.commit();
//
//			} catch (Exception e) {
//				Logger.logExceptions(this, e);
//				srvLocator.userTransactionRollBack(userTrans);
//				throw e;
//			}
//
//		} catch (Exception e) {
//			Logger.logExceptions(this, e);
//			throw new DeleteRecordException(e.getMessage());
//		} finally {
//			try {
//				if (conn != null)
//					conn.close();
//			} catch (Exception e) {
//			Logger.logExceptions(this, e);
//			}
//		}
//	}


}
